import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: { title: '首页', icon: 'HomeFilled', top: true }
  },
  {
    path: '/info',
    name: 'Info',
    component: () => import('@/views/Info.vue')
  },
  {
    path: '/member-management',
    name: 'MemberManagement',
    meta: { title: '会员管理', icon: 'User',top: true},
    children: [
      {
        path: 'member',
        name: 'Member',
        component: () => import('@/views/MemberManagement/Member.vue'),
        meta: { title: '会员'}
      },
      {
        path: 'member-card',
        name: 'MemberCard',
        component: () => import('@/views/MemberManagement/MemberCard.vue'),
        meta: { title: '会员卡'}
      },
      {
        path: 'member-bind',
        name: 'MemberBind',
        component: () => import('@/views/MemberManagement/MemberBind.vue'),
        meta: { title: '会员绑定'}
      }
    ]
  },
  {
    path: '/course-management',
    name: 'CourseManagement',
    meta: { title: '团课管理', icon: 'Menu', top: true },
    children: [
      {
        path: 'course',
        name: 'Course',
        component: () => import('@/views/CourseManagement/Course.vue'),
        meta: { title: '团课课程'}
      },
      {
        path: 'course-table',
        name: 'CourseTable',
        component: () => import('@/views/CourseManagement/CourseTable.vue'),
        meta: { title: '团课课程表'}
      },
      {
        path: 'course-setting',
        name: 'CourseSetting',
        component: () => import('@/views/CourseManagement/CourseSettings.vue'),
        meta: { title: '团课预约设置'}
      }
    ]
  },
  {
    path: '/teacher-management',
    name: 'TeacherManagement',
    component: () => import('@/views/TeacherManagement/Teacher.vue'),
    meta: { title: '教师管理', icon: 'UserFilled', top: true },
  },
  {
    path: '/data-statistics',
    name: 'DataStatistics',
    meta: { title: '数据统计', icon: 'Histogram', top: true },
    children: [
      {
        path: 'member-card-statistics',
        name: 'MemberCardStatistics',
        component: () => import('@/views/DataStatistics/MemberCardStatistics.vue'),
        meta: { title: '会员卡统计'}
      },
      {
        path: 'charge-statistics',
        name: 'ChargeStatistics',
        component: () => import('@/views/DataStatistics/ChargeStatistics.vue'),
        meta: { title: '收费统计'}
      },
      {
        path: 'consume-statistics',
        name: 'ConsumeStatistics',
        component: () => import('@/views/DataStatistics/ConsumeStatistics.vue'),
        meta: { title: '课消统计'}
      },
      {
        path: 'course-statistics',
        name: 'CourseStatistics',
        component: () => import('@/views/DataStatistics/CourseStatistics.vue'),
        meta: { title: '总课次统计'}
      },
      {
        path: 'new-lose-statistics',
        name: 'NewLoseStatistics',
        component: () => import('@/views/DataStatistics/NewLoseStatistics.vue'),
        meta: { title: '新增与流失统计'}
      }
    ]
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
